package io.github.maojian.queue;

import java.util.ArrayDeque;
import java.util.Queue;

/**
 * @Auther: jian.mao
 * @Date: 2022/5/6 09:04
 * @Description:
 */
public class Q933 {

    private Queue<Integer> queue;

    public int ping(int t) {
        queue.offer(t);
        while (queue.peek() < t - 3000) {
            queue.poll();
        }
        return queue.size();
    }

    public Q933() {
        queue = new ArrayDeque<>();
    }
}
